import request from '@/utils/request';

/** 分享模块的设置数据 **/

//  获取配置
export function GetSharedSettings(params) {
    return request({
        url: '/cloudApi/marketing/shareSettings/getShareSettings',
        method: 'get',
        params
    })
}

// 保存分享配置
export function SaveSharedSettings(data) {
    return request({
        url: '/cloudApi/marketing/shareSettings/saveShareSettings',
        method: 'post',
        data
    })
}

/** 分享列表模块API **/

// 获取被分享商品列表 - 分页
export function GetShareGoodsList(params) {
    return request({
        url: '/cloudApi/marketing/shareGoods/getShareGoodsList',
        method: 'get',
        params
    })
}

// 修改被分享商品状态
export function UpdateShareGoodsStatus(data) {
    return request({
      url: '/cloudApi/marketing/shareGoods/updateStatus',
      method: 'post',
      data
    })
}

// 删除单个被分享商品
export function RemoveShareGoodsItem(data) {
    return request({
      url: '/cloudApi/marketing/shareGoods/removeShareGoods',
      method: 'post',
      data
    })
}
  
// 批量删除被分享商品
export function RemoveShareGoodsBatch(data) {
    return request({
        url: '/cloudApi/marketing/shareGoods/removeShareGoodsBatch',
        method: 'post',
        data
    })
}

// 编辑分享商品
export function UpdateSharedGoodOne(data) {
    return request({
        url: '/cloudApi/marketing/shareGoods/saveShareGoods',
        method: 'post',
        data
    })
}
  
// 批量编辑分享商品
export function UpdateSharedGoodAll(data) {
    return request({
        url: '/cloudApi/marketing/shareGoods/saveShareGoodsBatch',
        method: 'post',
        data
    })
}

// 待分享商品的列表
export function GetWaitSharedGoodsList(params) {
    return request({
        url: '/cloudApi/marketing/shareGoods/getGoodsList',
        method: 'get',
        params
    })
}

/** 分享客管理API **/

// 获取分享客列表
export function GetShareCustomerList(params) {
    return request({
        url: '/cloudApi/marketing/shareCustomer/getShareCustomerList',
        method: 'get',
        params
    })
}

// 修改分享客状态
export function UpdateShareCustomerStatus(data) {
    return request({
        url: '/cloudApi/account/user/updateStatus',
        method: 'post',
        data
    })
}

// 分享者审核列表
export function GetShareAuditList(params) {
    return request({
        url: '/cloudApi/marketing/shareCustomer/getAuditList',
        method: 'get',
        params
    })
}

// 分享者单个审核
export function UpdateShareAuditStatus(data) {
    return request({
        url: '/cloudApi/marketing/shareCustomer/audit',
        method: 'post',
        data
    })
}

// 分享者批量审核
export function UpdateShareAuditBatchStatus(data) {
    return request({
        url: '/cloudApi/marketing/shareCustomer/auditBatch',
        method: 'post',
        data
    })
}

// 获取某个分享客的详细信息
export function GetSharedSharerOneDetail(params) {
    return request({
        url: '/cloudApi/marketing/shareCustomer/getDetail',
        method: 'get',
        params
    })
}

// 获取某个分享客的业务明细列表
export function GetSharedSharerOneAccount(params) {
    return request({
        url: '/cloudApi/marketing/refundRecord/getRefundList',
        method: 'get',
        params
    })
}

// 获取某个分享客的邀请明细
export function GetSharedSharerOneInvite(params) {
    return request({
        url: '/cloudApi/marketing/userInvite/getMyInviteList',
        method: 'get',
        params
    })
}
